package Thread;

public class Dom13 {
    public static void main(String[] args) throws InterruptedException {
        Thread t=new Thread(()->{
            while (true){
                //System.out.println("hello thread");
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    throw new NullPointerException();
                }
            }
        });
        t.start();
        Thread.sleep(100);
        //指定时间的阻塞 TIMED_WAITING 状态
        System.out.println(t.getState());
        //join(时间)也会进入TIMED_WAITING 状态
       t.join(100);
        System.out.println(t.getState());
    }
}
